home *** CD-ROM | disk | FTP | other *** search
- Path: EU.net!sun4nl!ittpub!ittpub!nntp
- Newsgroups: comp.lang.c++
- Subject: Re: Question about exemplars
- Message-ID: <1996Mar14.134634.1806@ittpub>
- From: wil@ittpub.nl (Wil Evers)
- Date: 14 Mar 96 13:46:33 WET
- References: <31475C8B.41C6@corp.sgi.com>
- Distribution: world
- Nntp-Posting-Host: lintilla
-
- In article <31475C8B.41C6@corp.sgi.com> Vishwanath Raman
- <vish@corp.sgi.com> writes:
-
- > I am building a message library using Exemplars. I write objects from a
- > given class hierarchy into a buffer ( contiguously ) and then send the
- > buffer accross to a server/peer. I bring the objects back to 'life' by
- > invoking a virtual MakeObject method defined through the hierarchy.
- >
- > The problem is in trying to regenerate a message when the compilers used
- > in creating the client/peer and server/peer programs are DIFFERENT.
- >
- > This I assume is because of the way VTable pointers are stored within
- > the class address space.
- >
- > Any ideas to overcome this problem. Exemplars constitute a cool way of
- > regenerating hierarchy objects without parsing...
- >
- > A standardisation for the way class objects are stored in memory seems
- > to be in order???
- >
- > Thanks a mill for any feedback in advance, Vish
-
- This is a dead end. In C++, the only portable way to bring streamed
- objects back to life is:
-
- (1) Determine which constructor to call.
- (2) Determine the arguments to the constructor.
- (3) Call the constructor.
-
- Of course, an examplar object may be able to do part of that for you, but
- the bottom line is that any other method is platform- and/or
- compiler-specific.
-
- You can probably figure out yourself what that would mean if this to be
- done across different platforms/compilers: both sides will have to agree
- on the exact format of the data in the stream.
-
- Hope this helps,
-
- - Wil
-
-